<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>计次护理卡充值</title>
<meta name="decorator" content="default" />
<style type="text/css">
.form-horizontal .control-label {
	float: left;
	width: 80px;
	padding-top: 5px;
	text-align: right;
}

.form-horizontal .controlgroup {
	*padding-right: 20px;
	*display: inline-block;
	margin-left: 100px;
	*margin-left: 0;
}
</style>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#inputForm").validate(
						{
							submitHandler : function(form) {
								var rechargeTimes = $('#rechargeTimes').val();
								var costMoney = $('#costMoney').val();
								var cardName = $('#cardname').val();
								var content = "您选择了充值会员卡【" + cardName + "】共"
										+ rechargeTimes + "次, 需付费" + costMoney
										+ "元, 请确认消费信息是否正确？";
								global.confirm(content, function() {
									form.submit();
								});//confirm

							},
							focusInvalid : false,
							rules : {
								rechargeTimes : {
									required : true,
									digits : true,
									min : 1,
									max : 100
								},
								costMoney : {
									ifMoney : '#costMoney',
									required : true,
									number : true,
									min : 1,
									max : 1000000
								}
							},
							errorContainer : "#messageBox",
							errorPlacement : function(error, element) {
								$("#messageBox").text("输入有误，请先更正。");
								if (element.is(":checkbox")
										|| element.is(":radio")) {
									error.appendTo(element.parent().parent());
								} else {
									error.insertAfter(element);
								}
							},
							messages : {}
						});//validate
				disableExitMenu();

			});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div class="container">
		<tags:message content="${message}" />
		<div data-role="fieldcontain">
			<label>卡名</label> <input type="text" id="cardname" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.name}" />
		</div>
		<div data-role="fieldcontain">
			<label>护理项目</label> <input type="text" id="careName" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.careName}" />
		</div>
		<div data-role="fieldcontain">
			<label>护理间隔(天)</label> <input type="text" id="careDuration" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.careDuration}" />

		</div>
		<div data-role="fieldcontain">
			<label>开卡次数(次)</label> <input type="text" id="times" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.times}" />
		</div>
		<div data-role="fieldcontain">

			<label>剩余次数(次)</label> <input type="text" id="remainTimes" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.remainTimes}" />
		</div>
		<div data-role="fieldcontain">
			<label>开卡时间</label> <input type="text" id="careDuration" readonly
				value="${fns:formatDate(member.rechargeEleMgr.currentElement.cardDetail.beginDate,'yyyy-MM-dd HH:mm:ss')}" />

		</div>
		<div data-role="fieldcontain">
			<label>零售价(元)</label> <input type="text" id="retailPrice" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.retailPrice}" />
		</div>
		<div data-role="fieldcontain">
			<label>当前状态</label> <input type="text" id="state" readonly
				value="${member.rechargeEleMgr.currentElement.cardDetail.state}" />
		</div>
		<form:form class="form-horizontal" id="inputForm"
			modelAttribute="member.rechargeEleMgr.currentElement"
			action="${ctx}/cash/member/recharge/cardtimes/recharge" method="post">
			<input type="hidden" name="uuid"
				value="${member.rechargeEleMgr.currentElement.uuid}" />
			<div data-role="fieldcontain">
				<label>充值次数(次)</label> <input type="text" name="rechargeTimes"
					id="rechargeTimes"
					value="${member.rechargeEleMgr.currentElement.cardDetail.times}" />
			</div>
			<div data-role="fieldcontain">
				<label>店面优惠价(元)</label> <input name="costMoney" id="costMoney"
					value="${member.rechargeEleMgr.currentElement.cardDetail.price}" />
			</div>
			<div data-role="fieldcontain">
				<label>服务专员:</label> <select id="employeeId" name="employeeId">
					<c:forEach var="e" items="${member.employees}">
						<option value="${e.id}" ${e.id==member.employee.id?'selected':''}>${e.name}</option>
					</c:forEach>
				</select>
			</div>
			<div id="okbutton">
				<input type="submit" data-inline="true" value="确认充值" />
			</div>

			<div class="icon-buttons">
				<input type="button" data-inline="true" data-icon="back"
					onclick="return directOpenURL('${ctx}/cash/member/recharge/cardtimes')"
					data-iconpos="notext" value="返回" />
			</div>
		</form:form>
	</div>
</body>
</html>
